package com.hsnn.medstgmini.sys.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hsnn.medstgmini.Constants;
import com.hsnn.medstgmini.sys.model.SysUser;
import com.hsnn.medstgmini.sys.model.UserType;
import com.hsnn.medstgmini.sys.service.UserInforManager;


@Controller
@RequestMapping("/UserInfor")
public class UserInforController {

	
	@Autowired
	private UserInforManager userInforManager;
	
	@Autowired
	private HttpSession session;
	
	@Autowired
	private HttpServletRequest request;

	/**
	 * @category 获取当前登陆人信息
	 * @date 2015年6月14日
	 * @return
	 */
	public SysUser getUser() {
		return (SysUser) request.getSession().getAttribute(Constants.USERINFO);
	}
	/**
	 * 
	 * @category 跳转基本信息页面
	 * @Auther xugp
	 * @date 2015年6月26日 下午12:06:58
	 * @return
	 * @return String
	 */
	@RequestMapping("/UserInforList")
	public String getUserInforList(){
		SysUser sysUser = getUser();
		sysUser.setTypeName(UserType.getName(sysUser.getType())); 
		request.setAttribute("sysUser", sysUser);
		return "/sys/UserInfor";
	}
	
}
